package com.htstar.ovms.admin.api.feign;

import com.htstar.ovms.common.core.constant.ServiceNameConstants;
import com.htstar.ovms.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

/**
 * Description: 文件内部上传
 * Author: jinzhu
 * Date: Created in 2020/6/16
 * Company: 航通星空
 * Modified By:
 */
@FeignClient(contextId = "SysFileFeign", value = ServiceNameConstants.PLATFORM_SERVICE)
public interface SysFileFeign {

    /**
     * Description: 文件内部上传
     * Author: jinzhu
     * Company: 航通星空
     */
    @PostMapping("/sys-file/upload")
     R upload(@RequestParam("file") MultipartFile file);

    @PostMapping("/sys-file/files")
     void uploads(@RequestParam("bucketName")String bucketName,
                       @RequestParam("objectName")String objectName,
                       @RequestParam("stream") InputStream stream);


}
